package com.kfdx.dc.service.impl;

import java.util.List;
        import com.kfdx.dc.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import com.kfdx.dc.mapper.DcOrderInfoMapper;
import com.kfdx.dc.domain.DcOrderInfo;
import com.kfdx.dc.service.IDcOrderInfoService;

/**
 * 订单信息Service业务层处理
 *
 * @author cx
 * @date 2024-09-23
 */
@Service
public class DcOrderInfoServiceImpl extends ServiceImpl<DcOrderInfoMapper, DcOrderInfo> implements IDcOrderInfoService
{
    @Autowired
    private DcOrderInfoMapper dcOrderInfoMapper;

    /**
     * 查询订单信息
     *
     * @param orderId 订单信息主键
     * @return 订单信息
     */
    @Override
    public DcOrderInfo selectDcOrderInfoByOrderId(Long orderId)
    {
        return dcOrderInfoMapper.selectDcOrderInfoByOrderId(orderId);
    }

    /**
     * 查询订单信息列表
     *
     * @param dcOrderInfo 订单信息
     * @return 订单信息
     */
    @Override
    public List<DcOrderInfo> selectDcOrderInfoList(DcOrderInfo dcOrderInfo)
    {
        return dcOrderInfoMapper.selectDcOrderInfoList(dcOrderInfo);
    }

    /**
     * 新增订单信息
     *
     * @param dcOrderInfo 订单信息
     * @return 结果
     */
    @Override
    public int insertDcOrderInfo(DcOrderInfo dcOrderInfo)
    {
                dcOrderInfo.setCreateTime(DateUtils.getNowDate());
            return dcOrderInfoMapper.insert(dcOrderInfo);
    }

    /**
     * 修改订单信息
     *
     * @param dcOrderInfo 订单信息
     * @return 结果
     */
    @Override
    public int updateDcOrderInfo(DcOrderInfo dcOrderInfo)
    {
                dcOrderInfo.setUpdateTime(DateUtils.getNowDate());
        return dcOrderInfoMapper.updateById(dcOrderInfo);
    }

    /**
     * 批量删除订单信息
     *
     * @param orderIds 需要删除的订单信息主键
     * @return 结果
     */
    @Override
    public int deleteDcOrderInfoByOrderIds(Long[] orderIds)
    {
        return dcOrderInfoMapper.deleteDcOrderInfoByOrderIds(orderIds);
    }

    /**
     * 删除订单信息信息
     *
     * @param orderId 订单信息主键
     * @return 结果
     */
    @Override
    public int deleteDcOrderInfoByOrderId(Long orderId)
    {
        return dcOrderInfoMapper.deleteDcOrderInfoByOrderId(orderId);
    }
}
